package ifmo.group5512.data;


import ifmo.group5512.entity.Order;
import ifmo.group5512.util.DaoFactory;

import java.util.ArrayList;
import java.util.List;

public class DataManager {
    public static List<Order> getAllCurrentOrders(){
        List<Order> orders = new ArrayList<Order>();
        for(Object obj: DaoFactory.getInstance().getOrderDAO().getAllOrders()){
            orders.add((Order)obj);
        }
        return orders;
    }
    public static void setManufacturingPlan(List<Order> orders){

    }
    public static Integer getComplexityForOrder(Order order){
        return DaoFactory.getInstance().getOrderDAO().getComplexityForOrder(order);
    }
    public static Integer getDaysToComplete(Order order){
        return DaoFactory.getInstance().getOrderDAO().getDaysToComplete(order);
    }
    public static List getNeededMaterials(Order order){
        return DaoFactory.getInstance().getOrderDAO().getNeededMaterials(order);
    }
    public static Integer getWaitingForMaterials(Order order){
        return DaoFactory.getInstance().getOrderDAO().getWaitingForMaterials(order);
    }
    public static void makeMaterialOrder(){

    }
    public static void saveQueue(List<Order> orders){
        DaoFactory.getInstance().getOrderDAO().setNewOrdersQueue(orders);
    }
}
